<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>新增文件夹</title>
</head>
<body>
	<form id="forderForm" action="<%=path%>/mail/doForder" method="post">
		<table style="width: 100%; margin-top: 20px;">
			<input type="hidden" name="ids" value="${ids }" />
			<tr>
				<td style="width: 60px;">文件夹名：</td>
				<td><input type="text" name="forderName" id="forderName"
					class="easyui-validatebox"
					data-options="required:true,validType:['length[0,50]']"
					style="width: 90%; height: 25px;" /></td>
			</tr>
			
		</table>
	</form>

	<script type="text/javascript">
	$(function() {
		$('#forderForm').form({
			onSubmit : function() {

				var isValid = $(this).form('validate');
				return isValid; // 返回false终止表单提交
			},success : function(data) {
				if(data.indexOf("success")!=-1){
					d.panel('close');
					//重定向到发件件箱--体验不好，放弃
					//window.location.href="<%=path%>/mail/sent";
						var item = $('#move').menu('findItem', '自定义文件夹');
						$('#move').menu('appendItem', {
							parent : item.target, // the parent item element
							text :  $("#forderName").val(),
							iconCls : 'icon-standard-folder-go',
							onclick : function() {
								moveForder(data.replace("success_",""));
							}
						});
						dg.datagrid("reload");
						if(forderDg!=null){
							forderDg.datagrid("reload");
						}

					}

				}
			});
		});
		</body>
		</html>
	